package com.xrz.sxm.aj.activity;

import java.util.ArrayList;
import java.util.List;

import android.widget.ListView;

import com.lidroid.xutils.view.annotation.ViewInject;
import com.xrz.sxm.aj.adapter.ChangshiAdapter;
import com.xrz.sxm.aj.base.BaseAct;
import com.xrz.sxm.aj.entity.ChangshiData;

public class LiaoFaChangshi4Activity extends BaseAct {
	@ViewInject(R.id.list_changshi3)
	private ListView mListView;
	private ChangshiAdapter adapter;
	private List<ChangshiData> list = new ArrayList<ChangshiData>();
	private List<String> titles = new ArrayList<String>();
	private List<String> contents = new ArrayList<String>();
	private String[] temp_titles, temp_contents;

	@Override
	protected int setView() {
		return R.layout.layout_changshi3;
	}

	@Override
	protected void init() {
		initData();
		adapter = new ChangshiAdapter(this);
		mListView.setAdapter(adapter);
		adapter.appendToList(list);
	}

	private void initData() {
		temp_titles = getResources().getStringArray(R.array.wenxiantitles);
		temp_contents = getResources().getStringArray(R.array.wenxiancontents);
		for(String str:temp_titles){
		titles.add(str);	
		}
		for(String str:temp_contents){
		contents.add(str);	
		}
		
		ChangshiData data;
		for (int i = 0; i < titles.size(); i++) {
			data = new ChangshiData();
			data.setTitle(titles.get(i));
			data.setContent(contents.get(i));
			list.add(data);
		}
	}

	@Override
	protected String setTopTitle() {
		return null;
	}

	@Override
	protected boolean topHide() {
		return true;
	}
}
